package com.teachoa.enumtype;

public enum AskStatusEnum {
	
	WAIT(0, "待回复"),
	FINISHED(1, "已回复");
	
	private int code;
	private String desc;
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}
	private AskStatusEnum(int code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	public static AskStatusEnum getEnumByCode(int code) {
		AskStatusEnum[] enums = AskStatusEnum.values();
		for(AskStatusEnum enumtype:enums) {
			if(enumtype.getCode()==code) {
				return enumtype;
			}
		}
		return null;
	}

}
